package com.example.mapping.manage;

import com.example.mapping.domain.ColumnMetadata;
import com.example.mapping.domain.TableMetadata;
import com.example.mapping.sevice.TableService;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 表manage
 *
 * @author baoyoujia
 */
@Component
public class TableManage {

    private final TableService tableService;

    public TableManage(TableService tableService) {
        this.tableService = tableService;
    }

    public List<TableMetadata> getTableMetadata() {
        return tableService.getTableMetadata();
    }

    /**
     * 获取表的所有列
     *
     * @param tableName 表名
     * @return 列信息
     */
    public List<ColumnMetadata> getColumnMetadata(String tableName) {
        return tableService.getColumnMetadata(tableName);
    }
}
